<template>
  <div>
      <div class="head"><strong>首页</strong> > 数据统计 > 数据报表</div>
      <el-card>
 <div class="main" style="width: 600px;height:400px;"></div>
      </el-card>
  </div>
</template>

<script>
//导入echarts
import * as echarts from 'echarts'
export default {
   
async mounted(){
    //2
    var myChart = echarts.init(document.getElementById('main'));
    const{data:res}=await this.$http.get(`reports/type/1`)
    if(res.meta.status!==200){
        return this.$message.error(res.meta.msg)
    }
    
        
      //4
 myChart.setOption(res.data);
},

}
</script>

<style lang='less' scope>
.head {
  margin-left: 20px;
  margin-top: 25px;
  font-size: 14px;
  margin-bottom: 20px;
}
.main{
    margin: 0 auto;
}
</style>